#include<bits/stdc++.h>
using namespace std;
#define N 1000010
#define db long double
int n,stk[N],top;
db ans;
double as;

int read()
{
	int z=0;
	char c=getchar();while(c<'0'||c>'9')c=getchar();
	while(c>='0'&&c<='9')
	{
		z=(z<<3)+(z<<1)+c-'0';
		c=getchar();
	}
	return z;
}

struct A{
	db h,r,R;
	db vl,w,u,v;
}a[N];

db gt1(db x,db y,db z,db op)
{
	if(x>y)return 0.0;
	else return op*(y-x)/z;
}

/*db gt1(db x,db y,db z)
{
	if(x>y)return 0.0;
	else return (y-x)*z;
}*/

void ins(int i)
{
	int x;db z;
	while(1)
	{
		if(!top){stk[++top]=i;break;}
		x=stk[top];
		if(a[i].r>=a[x].R)
		{
			a[i].u=a[x].v;a[i].v=a[i].u+a[i].h;
			--top;
		}
		else if(a[i].R<=a[x].r)
		{
			if(a[x].u>a[i].u){a[i].u=a[x].u;a[i].v=a[i].u+a[i].h;}
			if(a[i].v<a[x].v){stk[++top]=i;break;}
		    else --top;
		}
		else if(a[i].vl<=a[x].vl)
		{
		    z=gt1(a[x].r,a[i].r,a[x].w,a[x].h);
		    //z=gt1(a[x].r,a[i].r,a[x].w);
		    if(a[x].u+z>a[i].u){a[i].u=a[x].u+z;a[i].v=a[i].u+a[i].h;}
		    if(a[i].v<a[x].v){stk[++top]=i;break;}
		    else --top;
		}
		else
		{
			if(a[i].R<a[x].R)
			{
				z=min(gt1(a[i].R,a[x].R,a[x].w,a[x].h),a[x].h-a[i].h);
				//z=min(gt1(a[i].R,a[x].R,a[x].w),a[x].h-a[i].h);
				if(a[x].v-z>a[i].v){a[i].v=a[x].v-z;a[i].u=a[i].v-a[i].h;}
				if(a[i].v<a[x].v){stk[++top]=i;break;}
				else --top;
			}
			else
			{
				z=max(gt1(a[x].R,a[i].R,a[i].w,a[i].h),a[i].h-a[x].h);
				//z=max(gt1(a[x].R,a[i].R,a[i].w),a[i].h-a[x].h);
				if(a[x].v+z>a[i].v){a[i].v=a[x].v+z;a[i].u=a[i].v-a[i].h;}
				--top;
			}
		}
	}
}

int main()
{
	freopen("wan.in","r",stdin);
	freopen("wan.out","w",stdout);
	n=read();
	for(int i=1;i<=n;++i)
	{
	    a[i].h=1.0*read();a[i].r=1.0*read();a[i].R=1.0*read();
		a[i].vl=(a[i].R-a[i].r)/a[i].h;
		a[i].w=a[i].R-a[i].r;
		//a[i].w=a[i].h/(a[i].R-a[i].r);
		a[i].u=0.0;a[i].v=a[i].h;
	}
	stk[++top]=1;
	for(int i=2;i<=n;++i)ins(i);
	for(int i=1;i<=n;++i)ans=max(ans,a[i].v);
	as=ans;
	printf("%.9lf",as);
	return 0;
}
